﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IDAL;
using DAL;
using Models;

namespace BLL
{
    public class ServiceCategoryLogic
    {
        public static IServiceCategory servicecategory = new ServiceCategoryDAL();
        public static List<ServiceCategoryInfo> GetServiceCategory(int CategoryID)
        {
            List<ServiceCategoryInfo> list = servicecategory.GetServiceCategory();
            for (int i = 0; i < list.Count; i++)
            {
                if (list[i].CategoryID == CategoryID)
                {
                    list[i].HasChoose = "";
                    list[i].NowPlace = "";
                }
                else
                {
                    list[i].HasChoose = "current";
                    list[i].NowPlace = "nowcf";
                }
            }
            return list;
        }

        public static List<ServiceCategoryInfo> GetAllServiceCategoryInfo()
        {
            return servicecategory.GetServiceCategory();
        }

        public static ServiceCategoryInfo GetOneServiceCategory(int CategoryID)
        {
            return servicecategory.GetOneServiceCategoryInfo(CategoryID);
        }
    }
}
